//********************************************************************************************************************//
//ORGANIZATION:
//AUTHOR: bpeng(bogers.peng@gmail.com)
//SUMMARY:
//********************************************************************************************************************//
#ifndef NATIVE_SYSTEM_BASE_RUNTIMEEXCEPTION_H
#define NATIVE_SYSTEM_BASE_RUNTIMEEXCEPTION_H

#ifndef NATIVE_SYSTEM_BASE_EXCEPTION_H
#include "System/Base/Exception.h"
#endif

namespace Native { namespace System
{
    //****************************************************************************************************************//
    //CRuntimeException
    //
    //****************************************************************************************************************//
    NATIVE_DECLARE_CONST_OBJECT(CRuntimeException, C_RUNTIME_EXCEPTION);
    class NATIVE_LIBRARY_EXPORT CRuntimeException
        :public CException
    {
        NATIVE_DECLARE_OBJECT;

    public:
        typedef function<bool(wstring&)> FValidate;

    public:
        static void Check(
            C_SCENE& scene,
            FValidate validate,
            WSTRING& arguments = EMPTY_STRING,
            WSTRING& detail = EMPTY_STRING) throw();

    protected:
        CRuntimeException();
    public:
        CRuntimeException(C_RUNTIME_EXCEPTION& that);
        CRuntimeException(C_RUNTIME_EXCEPTION&& that);
        CRuntimeException(
            C_SCENE& scene,
            WSTRING& message,
            WSTRING& arguments = EMPTY_STRING,
            WSTRING& detail = EMPTY_STRING);
    };
}}

#endif